Data Form Wizard

The Data Form Wizard is designed to automatically generate Visual Basic forms that contain individual bound controls and procedures used to manage information derived from database tables and queries. You can use the Data Form Wizard to create either single query forms to manage the data from a single table or simple query, or Master/Detail type forms used to manage more complex one-to-many data relationships. The Data Form Wizard is used in conjunction with either the Data or the RemoteData controls.

Use the Data Form Wizard to:

•	Rapidly build forms with controls bound to a data source.

•	Create single record, grid, and Master/Detail forms.

•	Rapidly create prototype data based forms.

Since you can create two types of forms, some steps of the Data Form Wizard are different for each type.

•	To create single table forms, the Data Form Wizard follows these steps:

Introduction

Database Type

Database

Form

Record Source

Control Selection

Finished!

•	To create Master/Detail forms, the Data Form Wizard follows these steps:

Introduction

Database Type

Form

Master Record Source

Detail Record Source

Record Source Relation

Control Selection

Finished!

•	In addition to the previous steps, data forms that contain RemoteData controls, also have a Connect Information step.


Data Form Wizard-Introduction
Data Form Wizard—Introduction

The Data Form Wizard is designed to automatically generate Visual Basic forms that contain individual bound controls and procedures used to manage information derived from local or remote data sources. You can use the Data Form Wizard to create either single query forms to manage the data from a single table or query, or Master/Detail type forms to manage more complex one-to-many data relationships. The Data Form Wizard is used in conjunction with either the Data or the RemoteData controls.

Wizard Options

Skip this screen in the future   When selected, the Data Form Wizard will not show the Introduction step the next time you start it.

If you want to see this step in the future, click the Back button on the first step of the wizard.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   The Back button is unavailable on the Introduction step.

Next   Moves you to the next step.

Finish   Accepts the defaults and builds the appropriate data form. The Finish button is unavailable when you didn’t make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Database Type
Data Form Wizard—Database Type

Allows you to select the format of the data source you want to use for this form.

Wizard Options

Database Formats List   Lists the database formats available to Visual Basic. The available database formats are:

•	Access — Any version of the Microsoft Access .MDB (Jet) database.

•	dBASE — dBASE III, dBASE IV, or dBASE 5.0.

•	FoxPro — FoxPro versions 2.0, 2.5, 2.6, or 3.0.

•	Paradox — Paradox versions 3.x, 4.x, or 5.x.

•	Remote (ODBC) — Any ODBC compliant database driver.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Database
Data Form Wizard—Database

Allows you to select the database file you want to use for your data form. This is used when your database type is not Remote (ODBC).

Wizard Options

Database Name   Lets you enter the name of the database file or displays the name of the database file you selected using Browse.

Browse   Displays the Open dialog box so you can search for the database file you want to use.

Record Sources   Lets you choose which type of source you want to use.

•	Tables — Displays tables from the database you selected.

•	Queries — Displays query definitions from the database you selected. Only available for Microsoft Access databases (.MDB).

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Connect Information
Data Form Wizard—Connect Information

Collects the information needed to connect to an ODBC data source and allows you to select the type of data control you want to use. This step only appears if you chose Remote (ODBC) for the database format in the Database Type step.

Wizard Options

ODBC Connect Data   Collects information needed to connect to a remote data source.

•	DSN (Data Source Name) — Displays a list of DSNs currently installed on your computer to which you can connect. Use the 32-bit ODBC icon in the control panel to install new DSNs. Not available if you select a driver.

•	UID (User ID) — Allows you to type the User ID required to connect to this data source. If the data source does not require a user ID, you can leave this blank. Not available if you select a driver.

•	PWD (Password) — Allows you to type the password required to connect to the data source. If the data source does not require a password, you can leave this blank. Not available if you select a driver.

•	Database — Allows you to type the name of the database to which you want to connect. Not available if you select a driver.

•	Driver — Displays a list of drivers currently available on your computer that you can use to create a connection to a Remote data source. Not available if you select a DSN.

•	Server — Allows you to type the name of the server where the database resides. Not available if you select a DSN.

Data Control Type   Specifies which data control you want to use to access the specified data.

•	Data Control — Uses the Data Control to access the specified data.

•	Remote Data Control — Uses the RemoteData control to access the specified data. If the RemoteData control is not registered, this option is not available. Only available in the Enterprise edition.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is unavailable when you didn’t make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Record Source
Data Form Wizard—Record Source

Allows you to choose the record source and fields within the record source to place on the form.

Wizard Options

Record Source   Lists available record sources in the database you chose.

Available Fields   Lists the available fields in the selected record source.

Selected Fields   Lists the fields to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields in your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields in your form. Each time you click the button, the selected field in the Selected Fields list moves down one position.

Column to Sort By   Specifies the field you want to use for sorting.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Master Record Source
Data Form Wizard—Master Record Source

Allows you to choose the record source and fields of the record source to place on the Master form.

Wizard Options

Record Source   Lists available record sources in the database you chose.

Available Fields   Lists the available fields in the selected record source.

Selected Fields   Lists the fields to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields in your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields in your form. Each time you click the button, the selected field in the Selected Fields list move down one position.

Column to Sort By   Specifies the field you want to use for sorting.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Form
Data Form Wizard—Form

Allows you to select the type of form you want to create.

Wizard Options

Form Layout   List options for the layout of your data form.

•	Single record — Specifies a form that displays one record at a time. This is the default.

•	Grid (Datasheet) — Specifies a form that displays the selected fields in the Grid (Datasheet) format using the data bound grid (DBGrid) control.

•	Master/Detail — Specifies a form that displays a Master record source and a Detail record source linked together. The Master record source is in single record format and the Detail record source is in a Grid (Datasheet) format. When data in a Master record source row changes, the data in the Detail record source automatically changes based on the link between the two.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Detail Record Source
Data Form Wizard—Detail Record Source

Asks you to choose the second record source (Detail) and the fields you want to use from it. This step only appears if you choose the Master/Detail type of data form.

Wizard Options

Record Source   Lists available record sources in the database you chose.

Available Fields   Lists the available fields in the specified record source.

Selected Fields   Lists the fields you want to include in your form.

Moves the selected field in the Available Fields list to the Selected Fields list.

Moves all of the fields in the Available Fields list to the Selected Fields list.

Moves the selected field in the Selected Fields list to the Available Fields list.

Moves all of the fields in the Selected Fields list to the Available Fields list.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list moves up one position.

Changes the order of the fields on your form. Each time you click the button, the selected field in the Selected Fields list move down one position.

Column to Sort By   Specifies the field you want to use for sorting.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Control Selection
Data Form Wizard—Control Selection

Allows you to choose the controls you want to appear on the form and enables the wizard to create the associated code for each control.

Wizard Options

Available Controls   Lists the controls available for your form.

•	Add Button — When checked places an Add button on the form with the associated code to add new records to the database.

•	Delete Button — When checked places a Delete button on the form with the associated code to delete records from the database.

•	Refresh Button — When checked places a Refresh button on the form with the associated code to refresh data from the database.

•	Update Button — When checked places an Update button on the form with the associated code to update data from the database.

•	Close Button — When checked places a Close button with the associated code to close your form.

•	Show Data Control — When checked makes the Data Control visible on your form.

•	Select All — Selects all available controls.

•	Clear All — Clears all available controls.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Record Source Relation
Data Form Wizard—Record Source Relation

Allows you to create a one-to-many join between the Master and Detail record sources This step only appears if you chose the Master/Detail type of data form.

Wizard Options

Master Record Source   Lists all available fields from the record source you specified in the Master Record Source step. Clicking a field highlights it and registers it as the linking field for this record source.

Detail Record Source   Lists all available fields from the record source you specified in the Detail Record Source step. Clicking the same field in this list highlights it and registers it as the linking field for the second record.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Moves you to the next step.

Finish   Accepts any selections you entered and the defaults for the remaining steps, then creates a data form. The Finish button is available once you make enough choices for the Data Form Wizard to create the appropriate form.


Data Form Wizard-Finished!
Data Form Wizard—Finished!

Allows you to give your form a name and to save the current setting as a default so that you can create additional forms using the same settings.

Wizard Options

Form Name box   Sets the name of your form. The record source name is used as the default form name. You can use the default name or type in a new one.

Save current settings as default   If selected, the current settings are saved and used each time you use the Data Form Wizard until you save new settings.

Help   Opens the Help topic for this step. You can also press F1 for help.

Cancel   Cancels your previous actions and closes the Data Form Wizard.

Back   Moves you to the previous step.

Next   Unavailable because there are no additional steps for the Data Form Wizard.

Finish   Creates a data form based on the settings you selected.


bound control

A data-aware control that can provide access to a specific column or columns in a data source through a RemoteData or Data control. A data-aware control can be bound to a RemoteData or Data control through its DataSource and DataField properties. When a RemoteData or Data control moves from one row to the next, all bound controls connected to the RemoteData or Data control change to display data from columns in the current row. When users change data in a bound control and then move to a different row, the changes are automatically saved in the data source.


result set

The results of a query. Result sets might contain rows when a query contains a Select statement. Action queries do not return rows but do return result sets that contain information about the operation, such as rows affected.


RemoteData control

Provides access to data stored in a remote ODBC data source. The RemoteData control allows you to move from row to row in a result set and to display and manipulate data from the rows using bound controls.


query

A formalized instruction to a database to either return a set of rows or perform a specified action on a set of rows, as specified in the query. For example, the following SQL query statement returns rows:

SELECT CompanyName FROM Publishers WHERE State = 'NY'

You can create and run select, action, parameter, and stored procedure queries.


join

A join is the database process of comparing the data in specified columns and using the comparison results to form a new table or result set from the rows that qualify.

Specifically, a join statement:

•	Specifies a column from each table.

•	Compares the value in those columns row by row.

•	Combines data from rows with qualifying rows into a new table or result set.